<template>
  <div>
    <div class="box">
      <div
        class="shop"
        v-for="item in jifen"
        :key="item.id"
      >
        <img :src="'http://139.198.178.82:9090/Shopping/'+item.productDetail.defaultImg">
        <p class="shopname">
          {{item.productDetail.name}}
        </p>
        <p class="jifen">
          积分:{{item.jifen}}
        </p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "jifenshop",
  data() {
    return {
      jifen: [],
    };
  },
  methods: {
    getjifenshop() {
      this.$post(this.url + "/jifen/selectJifenProduct").then((res) => {
        this.jifen = res.data;
      });
    },
  },
  created() {
    this.getjifenshop();
  },
};
</script>

<style scoped>
.box {
  display: flex;
  flex-wrap: wrap;
  width: 80%;
  margin: 0 auto;
}
.shop {
  width: 23%;
  margin: 10px;
  border: 1px solid lightgray;
}
img {
  width: 100%;
}
.jifen {
  text-align: center;
  font-size: 25px;
  color: orange;
}
p {
  margin: 10px;
}
.shopname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
</style>